import baseurl from './config.js'

const request = function(options) {
	options.url = baseurl + options.url;
	try {
		const token = uni.getStorageSync('token');
		const username = 'lsk';
		debugger
		if (token) {
			options.header = {
				'Authorization': token
			};
		} else {
			// uni.navigateTo({
			// 	url: '../../login/login/login'
			// });
			return;
		}
	} catch (err) {
		console.log(err)
	}
	return uni.request(options);
}
export default request;